package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot.ItemSetupService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 阀值设置
 * @author Yang yu
 * @version 1.0
 * @date 2020/7/17 18:54
 */
@Action
@RequestMapping(value="fireFightingIOT/itemSetup")
public class ItemSetupController extends BaseController {

    @Resource
    private ItemSetupService itemSetupService;
    /**
     * 监测项列表
     * @param jsonParam
     * @return
     */
    @At(value = "getItemSetupList", method = RequestMethod.POST)
    public RespEntity getItemSetupList(@RequestBody(required = false) JSONObject jsonParam) {
        return itemSetupService.getItemSetupList(jsonParam);
    }

    /**
     * 监测项插入
     * @param jsonParam
     * @return
     */
    @At(value = "insertItemSetup", method = RequestMethod.POST)
    public RespEntity insertItemSetup(@RequestBody(required = false) JSONObject jsonParam) {
        return itemSetupService.insertItemSetup(jsonParam);
    }

    /**
     * 语音短信状态列表
     * @param jsonParam
     * @return
     */
    @At(value = "getSendMsgStateList", method = RequestMethod.GET)
    public RespEntity getSendMsgStateList(@RequestBody(required = false) JSONObject jsonParam) {
        return itemSetupService.getSendMsgStateList(jsonParam);
    }

    /**
     * 设备语音短信状态新增
     * @param jsonParam
     * @return
     */
    @At(value = "insertSendMsgState", method = RequestMethod.POST)
    public RespEntity insertSendMsgState(@RequestBody(required = false) JSONObject jsonParam) {
        return itemSetupService.insertSendMsgState(jsonParam);
    }
    /**
     * 通讯记录分页列表
     * @param jsonParam
     * @return
     */
    @At(value = "getCommunicationRecordListPage", method = RequestMethod.GET)
    public RespEntity getCommunicationRecordListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return itemSetupService.getCommunicationRecordListPage(jsonParam);
    }

    /**
     * 一键开启或关闭语音短信
     * @param jsonParam
     * @return
     */
    @At(value = "oneClickOnOrOff", method = RequestMethod.POST)
    public RespEntity oneClickOnOrOff(@RequestBody(required = false) JSONObject jsonParam) {
        return itemSetupService.oneClickOnOrOff(jsonParam);
    }

//
//    /**
//     * 接入层调用接口
//     * @param jsonParam
//     * @return
//     */
//    @At(value = "getItem", method = RequestMethod.POST)
//    public RespEntity getItem(@RequestBody(required = false) JSONObject jsonParam) {
//        return itemSetupService.getItem(jsonParam);
//    }
}
